﻿@model AdminLoginModel
@using Urs.Admin.Models.Users

<link rel="stylesheet" href="/layuiadmin/style/login.css" media="all" />

<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login">
    <div class="layadmin-user-login-main">
        <div class="layadmin-user-login-box layadmin-user-login-header">
            <h2>系统管理后台</h2>
        </div>
        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-cellphone" for="LAY-user-login-cellphone"></label>
                <input type="text" name="AccountName" id="LAY-user-login-cellphone" placeholder="请输入手机号" class="layui-input">
            </div>
            <div class="layui-form-item">
                <div class="layui-row">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-smscode"></label>
                    <input type="password" name="Password" id="LAY-user-login-smscode" lay-verify="required" placeholder="密码" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-login-submit">登陆</button>
            </div>
        </div>

    </div>

    <div class="layui-trans layadmin-user-login-footer">

        <p>© 2019 <a href="http://www.urselect.com/" target="_blank">Urselect.com技术支持</a></p>
        <p>
            <span><a href="http://www.beian.miit.gov.cn/" target="_blank" rel="nofollow">粤ICP备14084822号-4</a></span>
        </p>
    </div>

</div>

<script>
    layui.config({
        base: '../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','admin','user'], function () {
        var $ = layui.$
            , setter = layui.setter
            , admin = layui.admin
            , form = layui.form
            , router = layui.router()
            ,DISABLED = 'layui-disabled';

        form.on('submit(LAY-login-submit)', function (obj) {
            var field = obj.field;
            $.post('@Url.Action("Index")', field, function (rep) {
                if (rep.success) {  //登入成功的提示与跳转
                    layer.msg('登入成功', {
                        offset: '15px'
                        , icon: 1
                        , time: 1000
                    }, function () {
                        location.href = '/admin';
                    });
                } else {
                    layer.msg(rep.msg, {
                        offset: '15px'
                        , icon: 1
                    });
                }
            });
            return false;
        });

    });
</script>
